package com.alex.starter;

import com.alex.starter.service.UserService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.stream.IntStream;

/**
 * starter启动类
 */
@SpringBootApplication
public class HelloStartApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(HelloStartApplication.class, args);
        UserService userService = context.getBean(UserService.class);


        IntStream.range(0, 10).forEach(item -> {
            System.out.println("item: " + item);
            userService.print();
        });
    }
}
